﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CoderJoe
{
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple=true)]
    public class AspectAttribute
        : Attribute
    {
        public AspectJoinPoint JoinPoint { get; private set; }
        public AspectCategory Category { get; private set; }
        public Type AspectType { get; private set; }
        public int Order { get; set; }

        public AspectAttribute(AspectJoinPoint joinPoint, AspectCategory category, Type aspectType)
        {
            JoinPoint = joinPoint;
            Category = category;
            AspectType = AspectType;
        }

        public IAspect CreateInstance()
        {
            return (IAspect)Activator.CreateInstance(AspectType);
        }

        internal IAspect CreateInstance(AspectContainer aspectContainer)
        {
            throw new NotImplementedException();
        }
    }
}
